<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>if语句</title>
</head>
<body>
	
</body>
<script type="text/javascript">
	if(true/false test) { //如果检查结果为true，执行某件事。
		Do something;
	}

	if(chosenContestant == "Eric") {  //==  判断两方事物是否相等。
		alert('hello');
	}
// if/else语句。
	if(decision == 1){
		curScene = 2;
		message = "123456";
	}else{
                     curScene = 3;
                     message = "654321";
	}

	if (curScene == 0){
		curScene = 1;
		message = "000";
	}else if(curScene == 1){
		if (decision == 1) {
			curScene = 2;
			message = "123456";
		}else {
			curScene = 3;
			message = "654321";
		}
	}
</script>
</html>